package desginmode.single

/**
 * 线程安全，懒加载(静态内部类单例)
 */
class ThreadSafeSingleInner private constructor() {

    fun getName() = "ThreadSafeSingleInner"

    companion object {
        fun get() = Holer.instance
    }

    private object Holer {
        val instance = ThreadSafeSingleInner()
    }
}

fun main(args: Array<String>) {
    print(ThreadSafeSingleInner.get().getName())
}
